<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" type="text/css" href="<%=path %>/static/css/css.css?1" />
<link rel="stylesheet" type="text/css" href="<%=path %>/static/jquery-ui/jquery-ui.min.css" />
<script type="text/javascript" src="<%=path %>/static/js/json2.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/jquery.js"></script>
<script type="text/javascript" src="<%=path %>/static/jquery-ui/jquery-ui.min.js"></script>
<script type="text/javascript" src="<%=path %>/static/layer/layer.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/gridview.js?v=1"></script>
<script type="text/javascript" src="<%=path %>/static/js/formview.js?v=1"></script>
<script type="text/javascript" src="<%=path %>/static/js/tool.js"></script>
<script type="text/javascript" src="<%=path %>/static/js/validate.js"></script>
<script type="text/javascript" src="<%=path %>/wechat/js/copy/ZeroClipboard.js"></script>
<SCRIPT type="text/javascript">
    <!--
	var gridSetting = {
			id:'FundGrid',
			po:"FundView",
			title:'账户资金',
			height:'auto',
			service:"uiServices!listSimple",
			tbId:"FundTb",
			hideCheckbox:true,
			pageInfo: {
				records: 12,//auto表示根据容器高度自动判断
				orderby : "id desc"
			},
			oper:{
                isDisplay:false,
            	operName:"",
            	url:"",
            	cssClass:"Operation",
            	width:100
            },
			fields:[
			   {
                   name: 'code',
                   descs:"流水号",
                   thstyle:"width:220px",
                   align:'center'
               }
               ,{
                   name: 'createDateTime',
                   descs:"发生时间",
                   align:'center',
                   thstyle:"width:160px",
                   type:'datetime'
               },
               {
                   name: 'type',
                   align:'center',
                   thstyle:"width:100px",
                   descs:"类型"
               },
               {
                   name: 'collection',
                   align:'left',
                   descs:"收款账户"
               },
               {
                   name: 'cashMoney',
                   align:'center',
                   thstyle:"width:100px",
                   descs:"金额（元）"
               },
               {
                   name: 'createUser',
                   descs:"操作人",
                   align:'center',
                   thstyle:"width:80px"
               }
			]
		};
	var grid;
    $(document).ready(function(){
    	grid = new GridView("list",gridSetting,"list");
		grid.init();
		var data = [];
		grid.load({data:data});

		ajustHeight();

    });

    //-->
</SCRIPT>
</head>

<body>
<div class="rcon2" style="padding-bottom:0;">
   <table class="ctable">
      <tr>
         <td>
            总资金：<span id="TotalFund"></span>元
         </td>
         <td style="padding-left:22px;">
            可用资金：<span id="AvailFund"></span>元
         </td>
         <td style="padding-left:22px;">
            可用资金：<span id="BlockFund"></span>元
         </td>
      </tr>
   </table>
</div>
<div class="rcon2">
<table class="ctable">
   <tr>
      <td>
         <select name="type" style="width:100px;">
            <option value="">类型</option>
            <option value="充值">充值</option>
            <option value="提现">提现</option>
         </select>
      </td>
      <td><input type="text" name="code" placeholder="流水号" /></td>
      <td><input type="text" name="collection" placeholder="收款账户" /></td>
      <td>
         <input type="text" onclick="WdatePicker()" name="createDateTime" placeholder="开始时间" />-<input type="text" onclick="WdatePicker()" name="createDateTime" placeholder="结束时间" />
      </td>
      <td>
         <input type="button" class="btn2" value="查询" id="queryBtn">
      </td>
   </tr>
</table>
</div>
<div id="formview" class="rbox1"></div>
<div id="list" class="rbox2"></div>
<script type="text/javascript" src="<%=path %>/static/js/underscore.js"></script>
<script type='text/javascript' src='<%=path %>/static/My97DatePicker/WdatePicker.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/engine.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/util.js'></script>
<script type='text/javascript' src='<%=path %>/dwr/interface/BaseDwr.js'></script>
<script>
    $(function(){
       $.getJSON(g_path+"/public/common/getUserFund.htmls",function(data){
          $("#TotalFund").html(data.TotalFund==null?0:data.TotalFund);
          $("#AvailFund").html(data.AvailFund==null?0:data.AvailFund);
          $("#BlockFund").html(data.BlockFund==null?0:data.BlockFund);
       });
    });
    $("#queryBtn").click(function(){
       var type = $(".ctable").find(":input[name=type]").val();
       var code = $(".ctable").find(":input[name=code]").val();
       var collection = $(".ctable").find(":input[name=collection]").val();
       var createDateTime1 = $(".ctable").find(":input[name=createDateTime]:eq(0)").val();
       var createDateTime2 = $(".ctable").find(":input[name=createDateTime]:eq(1)").val();

       var data = [];
       if(type!==""){
          data.push({r:"=",name:'type',value:type});
       }
       if(code!==""){
          data.push({r:"like",name:'code',value:"%"+code+"%"});
       }
       if(collection!==""){
          data.push({r:"like",name:'collection',value:"%"+collection+"%"});
       }
       if(createDateTime1!==""){
          data.push({r:">=",name:'createDateTime',value:createDateTime1});
       }
       if(createDateTime2!==""){
          data.push({r:"<=",name:'createDateTime',value:createDateTime2});
       }

       grid.load({data:data});
       ajustHeight();
    });

</script>
</body>
</html>